#pragma once
#include "baseobject.h"
#include "sdl_opengl.h"

#include "CommonInclude.h"

namespace EPOC
{
	class Texture2D : public BaseObject
	{
	public:
		Texture2D();
		virtual ~Texture2D();
		

		virtual void Cleanup();
		virtual bool Initialize(const char* sName, const char* sFilePath, SDL_Surface *pSDLSurface, bool bExclusive = false, bool bEditable = false);	
		virtual bool UpdateTexture();
			
		virtual GLuint BuildGLTexture(SDL_Surface *pSDLSurface, bool bRemove = true);
	
		inline GLuint GetGLTexture()				{ return texture;}
		inline bool IsEditable()					{ return editable;}

	protected:
		inline void SetGLTexture(GLuint hTexture)	{ texture = hTexture;}
		virtual bool RebuildGLTexture();

	protected:
		bool editable;
		GLuint texture;
		bool exclusive;

		std::string name;
		std::string filePath;
		
		//Dimension2D m_vDimension;
		SDL_Surface *SDLSurface;		


	};
};

